package cn.edu.sjtu.message_management.util;

import com.auth0.jwt.JWT;

public class JWTUtil {

    public static String decodeUserId(String token) {
        return JWT.decode(token).getAudience().get(0);
    }

    public static String decodeUsername(String token) {
        return JWT.decode(token).getClaim("username").asString();
    }
}
